<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>交易管理 - 银行储蓄系统</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.1.3/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700&display=swap" rel="stylesheet">
    <style>
        body {
            min-height: 100vh;
            margin: 0;
            background: linear-gradient(135deg, #e0e7ff 0%, #f0fdfa 100%);
            font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .glass-card {
            background: rgba(255, 255, 255, 0.7);
            border-radius: 24px;
            box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.18);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.3);
            max-width: 1200px;
            width: 100%;
            padding: 40px 36px 36px 36px;
            margin: 40px auto;
            /* animation: fadeIn 1.2s cubic-bezier(.39,.575,.56,1.000); */
        }
        /* @keyframes fadeIn {
            0% { opacity: 0; transform: translateY(40px); }
            100% { opacity: 1; transform: translateY(0); }
        } */
        .bank-title {
            text-align: center;
            color: #2563eb;
            font-size: 2rem;
            font-weight: 700;
            letter-spacing: 2px;
            margin-bottom: 32px;
            text-shadow: 0 2px 8px rgba(37,99,235,0.08);
        }
        .table thead th {
            background-color: #e0e7ff;
            color: #2563eb;
            font-weight: 700;
        }
        .action-btns button, .action-btns a {
            margin-right: 5px;
        }
        .btn {
            border-radius: 12px !important;
            font-weight: 600;
            transition: transform 0.18s, box-shadow 0.18s;
        }
        .btn:hover {
            transform: translateY(-2px) scale(1.03);
            box-shadow: 0 6px 24px rgba(37,99,235,0.13);
        }
        .table {
            background: rgba(255,255,255,0.98);
            border-radius: 12px;
            overflow: hidden;
        }
    </style>
</head>
<body>
<div class="glass-card">
    <h2 class="bank-title">交易管理</h2>
    <form class="row g-3 mb-3" th:action="@{/admin/trade}" method="get">
        <div class="col-md-3">
            <input type="text" class="form-control" name="keyword" placeholder="卡号/姓名" th:value="${keyword}">
        </div>
        <div class="col-md-2">
            <button type="submit" class="btn btn-primary">搜索</button>
        </div>
        <div class="col-md-7 text-end">
            <a th:href="@{/admin/trade/export(keyword=${keyword})}" class="btn btn-info">导出CSV</a>
            <a href="/admin/main" class="btn btn-link">返回主页</a>
        </div>
    </form>
    <div class="table-responsive">
        <table class="table table-bordered table-hover align-middle">
            <thead>
                <tr>
                    <th>交易时间</th>
                    <th>交易类型</th>
                    <th>卡号</th>
                    <th>交易金额</th>
                    <th>备注</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <tr th:each="trade : ${trades}">
                    <td th:text="${#dates.format(trade.tradeDate, 'yyyy-MM-dd HH:mm:ss')}">2024-01-01 12:00:00</td>
                    <td th:text="${trade.tradeType}">存款</td>
                    <td th:text="${trade.cardID}">1234567890</td>
                    <td th:text="${trade.tradeMoney}">1000.00</td>
                    <td th:text="${trade.remark}">工资入账</td>
                    <td class="action-btns">
                        <a th:href="@{'/admin/trade/delete?cardID=' + ${trade.cardID} + '&tradeDate=' + ${#dates.format(trade.tradeDate, 'yyyy-MM-dd HH:mm:ss')} }" class="btn btn-sm btn-danger" onclick="return confirm('确定要删除该交易记录吗？')">删除</a>
                    </td>
                </tr>
                <tr th:if="${#lists.isEmpty(trades)}">
                    <td colspan="6" class="text-center">暂无交易记录</td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.1.3/js/bootstrap.bundle.min.js"></script>
</body>
</html> 